From 9f99dcafd0db14592d2f1ee982ccde6baf871ee1 Mon Sep 17 00:00:00 2001 From: Rob Browning Date: Mon, 4 Apr 2011 22:46:37 -0500 Subject: [PATCH] fix-fc-dual-font-width-calculation.diff * The font width should now be computed correctly for dual-width fonts. Patch: fix-fc-dual-font-width-calculation.diff Provided-by: Sven Joachim Date: Mon, 12 Jul 2010 16:32:53 +0200 Added-by: Rob Browning Status: incorporated upstream The Debian patch is taken from this upstream commit: revno: 99907 author: Naohiro Aota committer: Chong Yidong branch nick: emacs-23 timestamp: Wed 2010-06-30 10:22:18 -0400 message: Check FC_DUAL too. For such fonts, check width one by one (Bug#4129). * xftfont.c (xftfont_open): Check font width one by one also when spacing is dual. * ftfont.c (ftfont_open): Ditto. --- src/ChangeLog | 7 +++++++ src/ftfont.c | 2 +- src/xftfont.c | 2 +- 3 files changed, 9 insertions(+), 2 deletions(-) diff --git a/src/ChangeLog b/src/ChangeLog index f5c73db18e0..59eaf486738 100644 --- a/src/ChangeLog +++ b/src/ChangeLog @@ -8,6 +8,13 @@ * eval.c (Flet, Feval, Fapply, apply_lambda): Use SAFE_ALLOCA (Bug#6214). +2010-06-30 Naohiro Aota (tiny change) + + * xftfont.c (xftfont_open): Check font width one by one also when + spacing is dual. + + * ftfont.c (ftfont_open): Ditto. + 2010-05-18 Chong Yidong * character.c (Fstring, Funibyte_string): Use SAFE_ALLOCA to diff --git a/src/ftfont.c b/src/ftfont.c index 6956c134a7c..7801f22e26e 100644 --- a/src/ftfont.c +++ b/src/ftfont.c @@ -1262,7 +1262,7 @@ ftfont_open (f, entity, pixel_size) spacing = XINT (AREF (entity, FONT_SPACING_INDEX)); else spacing = FC_PROPORTIONAL; - if (spacing != FC_PROPORTIONAL) + if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL) font->min_width = font->average_width = font->space_width = (scalable ? ft_face->max_advance_width * size / upEM : ft_face->size->metrics.max_advance >> 6); diff --git a/src/xftfont.c b/src/xftfont.c index 5d4581be4e9..197cc9c1f5b 100644 --- a/src/xftfont.c +++ b/src/xftfont.c @@ -429,7 +429,7 @@ xftfont_open (f, entity, pixel_size) ascii_printable[i] = ' ' + i; } BLOCK_INPUT; - if (spacing != FC_PROPORTIONAL) + if (spacing != FC_PROPORTIONAL && spacing != FC_DUAL) { font->min_width = font->average_width = font->space_width = xftfont->max_advance_width; -- 2.30.2